/**
 * OperateLog 业务逻辑实现类
 * @author zhangq
 * @date 2015-1-28
 */
package com.chnbst.bstyun.service.impl;

import java.util.List;
import java.util.Map;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import com.chnbst.bstyun.core.base.BaseService;
import com.chnbst.bstyun.core.common.helper.DaoHelper;
import com.chnbst.bstyun.model.pojo.OperateLog;
import com.chnbst.bstyun.service.OperateLogService;

@Transactional
@Service
public class OperateLogServiceImpl extends BaseService implements OperateLogService {
	
	//声明命名空间
	private final static String nameSpace = "com.chnbst.bstyun.mapper.OperateLogMapper";

	@Transactional(propagation=Propagation.REQUIRED,readOnly=false)
	@Override
	public boolean insertOperateLog(OperateLog operateLog) {
		return DaoHelper.insert(nameSpace, "insertOperateLog", operateLog);
	}

	@Transactional(propagation=Propagation.REQUIRED,readOnly=false)
	@Override
	public boolean deleteOperateLog(Integer operateLogId) {
		return DaoHelper.delete(nameSpace, "deleteOperateLog", operateLogId);
	}

	@Transactional(propagation=Propagation.REQUIRED,readOnly=false)
	@Override
	public boolean updateOperateLog(OperateLog operateLog) {
		return DaoHelper.update(nameSpace, "updateOperateLog", operateLog);
	}

	@Transactional(propagation=Propagation.REQUIRED,readOnly=true)
	@Override
	public OperateLog selectOperateLog(Integer operateLogId) {
		return (OperateLog)DaoHelper.query(nameSpace, "selectOperateLog", operateLogId);
	}

	@SuppressWarnings("unchecked")
	@Transactional(propagation=Propagation.REQUIRED,readOnly=true)
	@Override
	public List<OperateLog> selectOperateLogList(Map<String, Object> map) {
		return (List<OperateLog>)DaoHelper.list(nameSpace, "selectOperateLogList", map);
	}

	@Transactional(propagation=Propagation.REQUIRED,readOnly=true)
	@Override
	public int selectOperateLogCount(Map<String, Object> map) {
		return DaoHelper.count(nameSpace, "selectOperateLogCount", map);
	}
}
